package com.book.helper;

import com.book.dto.AddressDto;
import com.book.pojo.Address;
import org.springframework.beans.BeanUtils;

public class AddressHelper {
    public static AddressDto covertPoDto(Address address){
        AddressDto addressDto = new AddressDto();
        BeanUtils.copyProperties(address,addressDto);
        return addressDto;
    }

    public static Address covertDtoPo(AddressDto addressDto) {
        Address address = new Address();
        BeanUtils.copyProperties(addressDto,address);
        return address;
    }
}
